<?php
include 'conf/db-config.php';
include 'submitemail.php';
$txtFullName = $_REQUEST['txtFullName'];
$txtUserName = $_REQUEST['txtUserName'];
$txtPass = $_REQUEST['txtPass'];
$txtEmailId = $_REQUEST['txtEmailId'];
$txtDOB = $_REQUEST['txtDOB'];
$txtPhone = $_REQUEST['txtPhone'];
$txtGender = $_REQUEST['txtGender'];
$txtQualification = $_REQUEST['txtQualification'];



if(strlen($txtUserName)>0 && strlen($txtPass)>0 && strlen($txtEmailId)>0)
{
	$sqlInsert = "INSERT INTO user_detail (`user_name`,`DOB`, `gender`, `country` ,`contact_no`,`fullname`) VALUES ('".$txtUserName."','".$txtDOB."', '".$txtGender."', '".$txtCountry."','".$txtPhone."','".$txtFullName."' )";
	//print $sqlInsert; 
	$run = mysql_query($sqlInsert);
	
	$sqlInsert2 = "INSERT INTO login_detail (`user_name`,`password`, `email`) VALUES ('".$txtUserName."', '".$txtPass."', '".$txtEmailId."')";
	//print $sqlInsert2;
	
	$run2 = mysql_query($sqlInsert2);
	//exit;
	if($run==1 && $run2==1)
	{
		$admin_mail_id = "avik@tech4bqa.com";
  		$message ="Hi $txtUserName,\n";
  		$message .="You have successfully registered. \n";
  		$message .="Your User Name :$txtUserName  \n";
  		$message .="Your Current Password :$txtPass  \n";
  		
  		$newMsg = GENERATE_SMTP_MAIL($admin_mail_id,$admin_mail_id,"My MBA Website",'','','You have registered Successfully',$message);
  		$message = "success";
	}
	
	?>
	<script>window.open('index.php','_self');</script>
	<?php 
	
}
